package com.net.oil.main.presenter;

import com.net.oil.base.BasePresenter;
import com.net.oil.main.bean.HomePageInfoBean;
import com.net.oil.main.contract.HomePageContract;
import com.net.oil.main.model.HomePageModel;

/**
 * 作者：lch
 * 时间：2018/4/5:10:28
 * 邮箱：245850413@qq.com
 * 说明：
 */

public class HomePagePresenter extends BasePresenter<HomePageContract.View> implements HomePageContract.Presenter {

    private HomePageContract.View view;
    private HomePageContract.Model model;

    public HomePagePresenter(HomePageContract.View view) {
        this.view = view;
        model = new HomePageModel(this);
    }

    @Override
    protected void unSubscribe() {
        model.unSubscribe();
    }

    @Override
    public void getHomePageInfo() {
        model.getHomePageInfo();
    }

    @Override
    public void getHomePageInfoSuccess(HomePageInfoBean homePageInfoBean) {
        view.getHomePageInfoSuccess(homePageInfoBean);
    }

    @Override
    public void getHomePageInfoFailed() {
        view.getHomePageInfoFailed();
    }
}
